package procsim;

import java.util.*;

public class OR extends LogicalElement{
    @Override
    public OR add(Signal sig){
        super.add(sig);
        return this;
    }
    @Override
    public OR tick(){
        res=0;
        Iterator iter = list.iterator();
        while(iter.hasNext())
            res=res | ((Signal)iter.next()).get();
        if(result!=null) result.set(res);
        invertIfNeeded();
        return this;
    }
}
